import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 城市信息信息 */
export interface City {
          province?: string; // 省份
          cityName?: string; // 城市名称
          adCode: string; // 行政区划代码
          isActive?: number; // 是否启用(1=启用,0=禁用)
  }

// 城市信息 API
export const CityApi = {
  // 查询城市信息分页
  getCityPage: async (params: any) => {
    return await request.get({ url: `/recycling/city/page`, params })
  },

  // 查询城市信息详情
  getCity: async (id: number) => {
    return await request.get({ url: `/recycling/city/get?id=` + id })
  },

  // 新增城市信息
  createCity: async (data: City) => {
    return await request.post({ url: `/recycling/city/create`, data })
  },

  // 修改城市信息
  updateCity: async (data: City) => {
    return await request.put({ url: `/recycling/city/update`, data })
  },

  // 删除城市信息
  deleteCity: async (id: number) => {
    return await request.delete({ url: `/recycling/city/delete?id=` + id })
  },

  /** 批量删除城市信息 */
  deleteCityList: async (ids: number[]) => {
    return await request.delete({ url: `/recycling/city/delete-list?ids=${ids.join(',')}` })
  },

  // 导出城市信息 Excel
  exportCity: async (params) => {
    return await request.download({ url: `/recycling/city/export-excel`, params })
  },
}